﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Cci;
using System.IO;
using Microsoft.Cci.ILToCodeModel;
using Microsoft.Cci.MutableCodeModel;

namespace ReactiveLang.AssemblyRewriter
{
    public class Program
    {
        static void Main(string[] args)
        {
            if (args == null || args.Length <2)
            {
                Console.WriteLine("usage: ReactiveCode.AssemblyRewriter.exe inputAssembly [outputAssembly]");
                return;
            }
            var rewriter = new Rewriter();
            rewriter.Errors += e =>
            {
                foreach (var err in e.Errors)
                    Console.WriteLine(err);
            };
            rewriter.Rewrite(args[0], args.ElementAtOrDefault(1) ?? args[0]);
        }
    }
}
